﻿using B.S.BasicData.ErrorCode;
using B.S.BasicData.Write.Application.Common.RolePremiss;
using MediatR;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.BasicData.Write.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [Authorize]
    public class RolePemissController : ControllerBase
    {
        private readonly IMediator mediator;

        public RolePemissController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 根据角色分配菜单
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult<int>> CreateRolePremissHandle(CreateRolePremissCommon request)
        {
            return await mediator.Send(request);
        }



        }
}
